package view.panel.prompt
{
	import control.panel.AlertButPanelControl;
	import control.panel.IPanelControl;
	
	import flash.events.MouseEvent;
	
	import view.components.ImgButton;
	
	public class AlertButPanel extends AlertPanel
	{
		private var confirmBut:ImgButton;
		private var type:String;
		
		public function AlertButPanel(panelControl:IPanelControl)
		{
			super(panelControl);
			isAlert = true;
			initBut();
		}
		
		private function initBut():void
		{
			confirmBut = new ImgButton(0,0,1,onBut,50,20,"butBg",null,"确定");
		}
		
		private function onBut(event:MouseEvent):void
		{
			(panelControl as AlertButPanelControl).onYes(type);
		}
		
		public function alertBut(content:String,type:String) : void
		{
			super.alert(content);
			this.type = type;
			confirmBut.x = (width - confirmBut.width) * .5;
			confirmBut.y = hintText.y + hintText.height + 3;
			addChild(confirmBut);
			resetBg(this.width,this.height+ 10,1,true);
			
		}
		
		
	}
}